 // 此文件用于生成路由,路由表以及配置路由
 import { createRouter,createWebHistory,createWebHashHistory } from "vue-router";
 import shopIndex from "../components/shop/index.vue"
 import shopList from "../components/shop/list.vue"
 import shopUser from "../components/shop/user.vue"
 import details from "@/components/shop/details.vue";

 // 路由表
 const routes=[
    // 路由
    {
        path:"/shop",
        name:"shopIndex",
        component:shopIndex
    },
    {
        path:"/list",
        name:"shopList",
        component:shopList,
        children:[
            {
                path:"details/:id",
                // path:"details",
                name:"details",
                component:details
            }
        ]
    },
    {
        path:"/user",
        name:"shopUser",
        component:shopUser
    }
 ]

 // 路由器
 const router = createRouter({
    history:createWebHistory(),
    // history:createWebHashHistory(),
    routes:routes
 })

export {router};